/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "docentexclase")
@NamedQueries({
    @NamedQuery(name = "Docentexclase.findAll", query = "SELECT d FROM Docentexclase d"),
    @NamedQuery(name = "Docentexclase.findByNDcnClsId", query = "SELECT d FROM Docentexclase d WHERE d.nDcnClsId = :nDcnClsId"),
    @NamedQuery(name = "Docentexclase.findByNnCicId", query = "SELECT d FROM Docentexclase d WHERE d.nCicId = :nCicId"),
    @NamedQuery(name = "Docentexclase.findByVEstado", query = "SELECT d FROM Docentexclase d WHERE d.vEstado = :vEstado"),
    @NamedQuery(name = "Docentexclase.findByFiltros", query = "SELECT d FROM Docentexclase d WHERE d.nCicId = :nCicId and d.nClsId = :nClsId")})
public class Docentexclase implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nDcnClsId")
    private Integer nDcnClsId;
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nDcnClsId")
    private List<Periodoxsalon> periodoxsalonList;
    @JoinColumn(name = "nGrpId", referencedColumnName = "nGrpId")
    @ManyToOne
    private Grupo nGrpId;
    @JoinColumn(name = "nDcnId", referencedColumnName = "nDcnId")
    @ManyToOne
    private Docente nDcnId;
    @JoinColumn(name = "nClsId", referencedColumnName = "nClsId")
    @ManyToOne(optional = false)
    private Clase nClsId;
    @JoinColumn(name = "nCicId", referencedColumnName = "nCicId")
    @ManyToOne(optional = false)
    private Ciclo nCicId;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "docentexclase")
    private List<Clasexsalon> clasexsalonList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "docentexclase")
    private List<Clasexperiodo> clasexperiodoList;

    public Docentexclase() {
    }

    public Docentexclase(Integer nDcnClsId) {
        this.nDcnClsId = nDcnClsId;
    }

    public Integer getNDcnClsId() {
        return nDcnClsId;
    }

    public void setNDcnClsId(Integer nDcnClsId) {
        this.nDcnClsId = nDcnClsId;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Periodoxsalon> getPeriodoxsalonList() {
        return periodoxsalonList;
    }

    public void setPeriodoxsalonList(List<Periodoxsalon> periodoxsalonList) {
        this.periodoxsalonList = periodoxsalonList;
    }

    public Grupo getNGrpId() {
        return nGrpId;
    }

    public void setNGrpId(Grupo nGrpId) {
        this.nGrpId = nGrpId;
    }

    public Docente getNDcnId() {
        return nDcnId;
    }

    public void setNDcnId(Docente nDcnId) {
        this.nDcnId = nDcnId;
    }

    public Clase getNClsId() {
        return nClsId;
    }

    public void setNClsId(Clase nClsId) {
        this.nClsId = nClsId;
    }

    public Ciclo getNCicId() {
        return nCicId;
    }

    public void setNCicId(Ciclo nCicId) {
        this.nCicId = nCicId;
    }

    public List<Clasexsalon> getClasexsalonList() {
        return clasexsalonList;
    }

    public void setClasexsalonList(List<Clasexsalon> clasexsalonList) {
        this.clasexsalonList = clasexsalonList;
    }

    public List<Clasexperiodo> getClasexperiodoList() {
        return clasexperiodoList;
    }

    public void setClasexperiodoList(List<Clasexperiodo> clasexperiodoList) {
        this.clasexperiodoList = clasexperiodoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nDcnClsId != null ? nDcnClsId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Docentexclase)) {
            return false;
        }
        Docentexclase other = (Docentexclase) object;
        if ((this.nDcnClsId == null && other.nDcnClsId != null) || (this.nDcnClsId != null && !this.nDcnClsId.equals(other.nDcnClsId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Docentexclase[ nDcnClsId=" + nDcnClsId + " ]";
    }
    
}
